#include <string>
#include "gtest/gtest.h"
#include "lock_free_ring_buffer.h"

namespace Base {
namespace SystemLog {
namespace {
constexpr size_t TEST_MESSAGE_SIZE = 128;
const char TEST_CHAR = 't';
} // namespace

class LockFreeRingBufferSecurityTest : public testing::Test {
public:
    static void SetUpTestCase(void) {}
    static void TearDownTestCase(void) {}
    void SetUp() {}
    void TearDown() {}
};

/**
 * @tc.name: LockFreeRingBufferSecurityTest_001
 * @tc.desc: memory leak detection
 * @tc.type: SECURITY
 */
TEST_F(LockFreeRingBufferSecurityTest, LockFreeRingBufferSecurityTest_001)
{
    {
        LockFreeRingBuffer<> buffer;
        const std::string msg(TEST_MESSAGE_SIZE, TEST_CHAR);
        EXPECT_EQ(buffer.Append(msg.c_str(), msg.size()), ERR_OK);
        // 不释放节点，测试内存泄漏
    }
}

} // namespace SystemLog
} // namespace Base
